#!/usr/bin/env bash
# 合同的坏账金额置为0,可提前刷掉,为了提前刷掉可采用时间做限制，如要刷2020-01-12 12:00:00前的数据，则endTime填写"2020-01-12 12:00:00"，如要刷2020-01-12 12:00:00后的数据,则startTime填写"2020-01-12 12:00:00"
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/contract/repairContractBad -X POST -H 'Content-type: application/json' -d '{"xbbCode":123456,"businessType":"201","startTime":"","endTime":""}'

#  预收款的mapping
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/saasDataMapping -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid":"1","userId":"1","platform":"web","saasMark":1,"businessType":712}'


#1 菜单模板处理（最先）
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/fund/menu/init -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","corpid":"1","userId":"1","xbbCode":123456,"platform":"web","saasMark":1}'
#10 回款单解释
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/fund/paymentSheet/explains/single -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456"}'


# ======以下可并行=======
#3 客户、合同tab名称修改(回款计划-->回款管理)
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/detail/tab/byType -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456","businessType":"201","operate":"0"}'

#4 回款计划模版处理
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/payment/updatePayment -X POST -H 'Content-type: application/json' -d '{"corpid":"1","userId":"1","platform":"web","attrList":["text_12","text_13","text_3","text_6","array_1","serialNo"],"businessType":701,"frontDev":"1","xbbCode":"123456"}'

#7  预收款表单和表单解释
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/fund/menu/initForm -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid":"1","userId":"1","platform":"web"}'

#8.1  合同解释
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/contract/explains -X POST -H 'Content-type: application/json' -d '{"xbbCode":123456,"businessType":"201"}'

#8.2  流程表单解释
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/flow/form/contract -X POST -H 'Content-type: application/json' -d '{"xbbCode":123456,"businessType":"201","operateFlag":"1"}'

#9  发票解释
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/initNewAll -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","fieldAttr":"attrName","businessType":901,"attr":"text_61","afterAttr":"text_4","xbbCode":"123456","operate":2}'
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/initNewAll -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","fieldAttr":"attrName","businessType":901,"attr":"text_62","afterAttr":"text_5","xbbCode":"123456","operate":2}'
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/initNewAll -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","fieldAttr":"attrName","businessType":901,"attr":"text_63","afterAttr":"text_10","xbbCode":"123456","operate":2}'
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/initNewAll -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","fieldAttr":"screenType","businessType":901,"attr":"text_4","xbbCode":"123456","operate":1}'
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/initNewAll -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","fieldAttr":"attrName","businessType":901,"attr":"text_5","xbbCode":"123456","operate":1}'
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/initNewAll -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","fieldAttr":"screenType","businessType":901,"attr":"text_5","xbbCode":"123456","operate":1}'
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/initNewAll -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","fieldAttr":"setType","businessType":901,"attr":"text_6","xbbCode":"123456","operate":1}'
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/initNewAll -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","fieldAttr":"setType","businessType":901,"attr":"subForm_1","xbbCode":"123456","operate":1}'
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/initNewAll -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","fieldAttr":"setType","businessType":901,"attr":"subForm_2","xbbCode":"123456","operate":1}'
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/initNewAll -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","fieldAttr":"attrName","businessType":901,"attr":"text_10","xbbCode":"123456","operate":1}'
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/initNewAll -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","fieldAttr":"screenType","businessType":901,"attr":"num_3","xbbCode":"123456","operate":1}'
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/initNewAll -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","fieldAttr":"screenType","businessType":901,"attr":"num_5","xbbCode":"123456","operate":1}'
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/initNewAll -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","businessType":901,"attr":"subForm_1","initMethod":"customerInvoice","initMethodField":"showAttrPermission","xbbCode":"123456","operate":1}'
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/initNewAll -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","businessType":901,"attr":"subForm_2","initMethod":"customerExpress","initMethodField":"showAttrPermission","xbbCode":"123456","operate":1}'
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/initNewAll -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","businessType":901,"attr":"text_5","initMethod":"paymentId","initMethodField":"isForbidden","xbbCode":"123456","operate":1}'
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/initNewAll -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","businessType":901,"attr":"text_5","initMethod":"paymentId","initMethodField":"showAttrPermission","xbbCode":"123456","operate":1}'

#9.1 退货退款解释
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/initNewAll -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","fieldAttr":"attrName","businessType":202,"attr":"text_6","xbbCode":"123456","operate":1}'
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/initNewAll -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","fieldAttr":"attrName","businessType":202,"attr":"text_7","xbbCode":"123456","operate":1}'





# ======以下可并行=======
#10.1 发票老数据修复（#9  发票解释）
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/contract/repairSerialNoData -X POST -H 'Content-type: application/json' -d '{"corpid":"1","userId":"1","platform":"web","frontDev":"1","xbbCode":"123456","corpidList":[],"businessType":"901"}'

curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/fixData/repairInvoiceRelationshipData -X POST -H 'Content-type: application/json' -d '{"corpid":"1","userId":"1","platform":"web","frontDev":"1","xbbCode":"123456","corpidList":[],"businessType":"901"}'

curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/fixData/repairApproveData -X POST -H 'Content-type: application/json' -d '{"corpid":"1","userId":"1","platform":"web","frontDev":"1","xbbCode":"123456","corpidList":[],"businessType":"901"}'

#10.3 发票审批节点  刷审批脚本（#9  发票解释）
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/fund/process/initProcess -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456","businessType":"901","attrList":["text_3","text_4","text_5","text_61","text_62"],"editable":0}'

curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/fund/process/initProcess -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456","businessType":"901","attrList":["text_5","text_61","text_62"],"visible":1}'

#10.4 退货退款审批 合计退款金额不允许编辑
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/fund/process/initProcess -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456","businessType":"202","attrList":["num_2"],"editable":0}'

#10.5 回款单审批节点 关联客户关联合同不可编辑
curl   http://pt2jobs.xbongbong.com.cn/pro/v1/script/fund/process/initProcess -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456","businessType":"702","attrList":["text_6","text_4"],"editable":0}'


#9 回款计划   严禁本条脚本重复刷、严禁本条脚本重复刷、严禁本条脚本重复刷
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/payment/scriptPaymentData -X POST -H 'Content-type: application/json' -d '{"xbbCode":123456,"businessType":"201"}'

#12 回款单打印模板
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/init/paymentSheet -X POST -H 'Content-type: application/json' -d '{"corpid":"1","userId":"1","platform":"web","xbbCode":"123456"}'


# 回款单(#10 回款单解释之后)
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/fund/paymentSheet/data -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456"}'

# 审批中回款单处理(#10 回款单解释之后)
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/fund/paymentSheet/process/data -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456"}'
